﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace cashautomat
{

    public partial class Form2 : Form
    {
        int cash;

        public int Getcash
        {
            get
            { return cash; }
        }

      
        public Form2()
        {
            InitializeComponent();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
        }

           
        private void button5_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            cash = Convert.ToInt32(textBox1.Text);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            cash = 50;
            this.Click += new System.EventHandler(this.button4_Click);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            cash = 100;
            this.Click += new System.EventHandler(this.button4_Click);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            cash = 500;
            this.Click += new System.EventHandler(this.button4_Click);
        }
    
    }
}
